<template>
  <a-layout id="components-layout-demo-custom-trigger">
    <a-layout-sider v-model="collapsed" :trigger="null" collapsible style="min-height: 100%">
      <div class="logo" style="text-align: center;color: #1890ff;padding: 5px">{{collapsed?"Vue":"伟大的Vue"}}</div>
      <a-menu theme="dark" mode="inline" :default-selected-keys="['1']">
        <a-menu-item key="1" @click="()=>$router.push('/')">
          <a-icon type="user" />
          <span>
<!--            <router-link to="/">home</router-link>-->
         Home
          </span>
        </a-menu-item>
        <a-menu-item key="3" @click="()=>$router.push('/plane')">
        <a-icon type="rocket" />
        <span>
            Plane
          </span>
      </a-menu-item>
        <a-menu-item key="4" @click="()=>$router.push('/girl')">
          <a-icon type="team" />
          <span>
            Girls
          </span>
        </a-menu-item>
        <a-menu-item key="5" @click="()=>$router.push('/lover')">
          <a-icon type="team" />
          <span>
            Lovers
          </span>
        </a-menu-item>
        <a-menu-item key="6" @click="()=>$router.push('/editLover')" >
          <a-icon type="team" />
          <span>
            编辑Lover
          </span>
        </a-menu-item>
        <a-menu-item key="7" @click="()=>$router.push('/event')">
          <a-icon type="team" />
          <span>
            event
          </span>
        </a-menu-item>
      </a-menu>
    </a-layout-sider>
    <a-layout>
      <a-layout-header style="background: #fff; padding: 0">
        <a-icon
          class="trigger"
          :type="collapsed ? 'menu-unfold' : 'menu-fold'"
          @click="() => (collapsed = !collapsed)"
        />
      </a-layout-header>
      <a-layout-content
        :style="{ margin: '24px 16px', padding: '24px', background: '#fff', minHeight: '280px' }"
      >
        <router-view/>
      </a-layout-content>
    </a-layout>
  </a-layout>
</template>
<script>
  export default {
    name: 'App',
    data() {
      return {
        collapsed: false,
      };
    },
    mounted() {
      this.$eventBus.$on("bigNews",(res)=>{
          this.$message.warn(res)
      })
    }
  };
</script>
<style>
  #components-layout-demo-custom-trigger .trigger {
    font-size: 18px;
    line-height: 64px;
    padding: 0 24px;
    cursor: pointer;
    transition: color 0.3s;
  }

  #components-layout-demo-custom-trigger .trigger:hover {
    color: #1890ff;
  }

  #components-layout-demo-custom-trigger .logo {
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    margin: 16px;
  }

  #root,body,html {
    height: 100%;
  }

  .ant-layout {
    display: flex;
    width: 100%;
    min-height: 100%;
  }

</style>


